#ifndef TEMPPROCESS_H
#define TEMPPROCESS_H

#include "common.h"
#include "point.h"

class TempProcess
{
private:
    int imgH = 0;
    int imgW = 0;
    double tMax;
    double tMin;
    std::map<QString,Point*> *tmp = new std::map<QString,Point*>();
    cv::Mat picUnDistort(cv::Mat &img);
    std::map<QString,Point*>* loadTempature(QString tempFile,int& imgH,int& imgW,double &tMax,double &tMin);
    std::map<QString,Point*>* loadTempature(std::map<QString,Point*>* t);
    std::map<std::string, double> setTempMap(QString tempFile);
    std::vector<QPoint> getCenter(QList<QPoint> pts);
    //std::vector<QPoint> convexHull(const std::vector<QPoint>& points);
public:
    TempProcess();
    TempProcess(QString fileName);
    void setTemp(QString fileName);
    cv::Mat showImage(QString fileName);
    QSize getSize();
    std::pair<double,double> getTmpDiff();
    cv::Mat getColorRuler();
    std::map<QString,Point*> getTempature();
    void setTempature(std::map<QString,Point*> *t);
    std::vector<QPoint *> getEnvelope(std::map<QPoint*,QString> pts);
    cv::Mat getScaleImage(cv::Mat &img, std::vector<cv::Point> region, std::map<std::string, double>& tmp, std::map<std::string, double> &regionTmp);
};

#endif // TEMPPROCESS_H
